<?php
# DateTime对象的使用
$dateTime = new DateTime();
$dateTime->setTimezone(new DateTimeZone("PRC"));
$dateTime->setTimestamp(time());
echo $dateTime->format('Y-m-d H:i:s');
echo PHP_EOL;
echo $dateTime->getTimestamp();
echo PHP_EOL;
$dateTime1 = DateTime::createFromFormat("Y/m/d H:i:s", "2021/1/10 10:01:11");
echo $dateTime1->format('Y-m-d H:i:s');
